package inge_soft.gestoriusNuevo.persistence.DAO.implementation;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import inge_soft.gestoriusNuevo.persistence.DAO.Exceptions.Abstraction.GestoriusException;
import inge_soft.gestoriusNuevo.persistence.DAO.abstraction.IDomicilioDAO;
import inge_soft.gestoriusNuevo.persistence.entity.implementation.Domicilio;
import inge_soft.gestoriusNuevo.persistence.entity.implementation.Pais;
import inge_soft.gestoriusNuevo.persistence.entity.implementation.Provincia;
import inge_soft.gestoriusNuevo.persistence.entity.implementation.TipoDomicilio;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Repository("domicilioDAO")
public class DomicilioDAO implements IDomicilioDAO {

	@PersistenceContext
	private EntityManager entityManager;
	
	@Transactional(propagation = Propagation.MANDATORY)
	public void crear(Domicilio domicilio) throws GestoriusException {
		entityManager.persist(domicilio);
	}

	@Transactional(propagation = Propagation.MANDATORY)
	public void modificar(Domicilio domicilio) throws GestoriusException {
		entityManager.merge(domicilio);
	}

	@Transactional(propagation = Propagation.MANDATORY)
	public void eliminar(Domicilio domicilio) throws GestoriusException {
		// TODO Auto-generated method stub
		
	}
}
